import static org.junit.Assert.*;

import org.junit.Test;


public class CardTest {

	@Test
	public void testConstructor() {
		Card a = new Card(3, 7);
		assertEquals(3, a.getColor());
		assertEquals(7, a.getFigure());
	}
	
	@Test
	public void testToString()
	{
		Card a = new Card(3, 7);
		assertEquals("9 of clubs", a.toString());
	}
	
	@Test(expected = CardException.class)
	public void testContructorThrows1()
	{
		Card a = new Card(-1, 7);
	}

	@Test(expected = CardException.class)
	public void testContructorThrows2()
	{
		Card a = new Card(10, 7);
	}
	
	@Test(expected = CardException.class)
	public void testContructorThrows3()
	{
		Card a = new Card(3, -1);
	}
	
	@Test(expected = CardException.class)
	public void testContructorThrows4()
	{
		Card a = new Card(3, 20);
	}
}
